<link href="__CDN__/assets/addons/qingdongwms/css/common.css?v={$Think.config.site.version}" rel="stylesheet">

<style type="text/css">
	.btn-list {
		position: fixed;
		right: 40px;
	}
	.div-flex {
		display: flex
	}
	.div-flex .form-group {
		margin-right: 50px;
		text-align: center;
		line-height: 25px;
		margin-bottom: 0;
	}
	.tab-pane {
		border: 1px solid #F6F6F6;
	}
	.i-color {
		font-size: 34px;margin-right: 10px;color: #86C3FF;
	}
	.thumbnail {
		display: flow-root;
		width: max-content;
	}
	.thumbnail img {
		width: 50px;
		float: left;
		padding: 5px;
	}
</style>

<style type="text/css">
	.examine_title{
		font-size: 14px;
		color: #333;
		-webkit-box-flex: 1;
		-ms-flex: 1;
		flex: 1;
		display: block;
		height: 30px;
	}
	.examine_box{
		padding-left:20px;
		position: relative;
	}
	.examine_box .newicon{
		position: absolute;
		left:0;
		top:0;
		z-index: 2;
	}
	.examine_box .xian{
		width:1px;
		height:100%;
		background:#e6e6e6;
		position: absolute;
		left:4px;
		top:10px;
		z-index: 1;
	}
	.examine_box .examine_bg{
		position: relative;
		margin-top: 15px;
		border-radius: 4px;
		background-color: #f7f8fa;
		font-size: 12px;
		color: #929293;
		padding: 8px;
		line-height: 18px;
	}
	.rowbox{
		display: flex;
		justify-content: flex-start;
		align-items: center;
	}
	.stafflist{
		width: 70px;text-align: center;float: left;
	}
	.stafflist-right{
		width: 30px;text-align: center;float: left;margin: 0 20px;

	}
	.stafflist-right:last-child{
		display: none;
	}
	.stafflist img{
		width: 40px;
		height: 40px;
		margin: 10px;
		border-radius:50%;
	}
</style>
<div id="toolbar" class="toolbar hidden">
	<a href="javascript:;" onclick="javascript:location.reload()" class="btn btn-primary btn-refresh"><i class="fa fa-refresh"></i></a>
</div>
<div class="panel panel-default panel-intro">
	<input type="hidden" name="ids" id="ids" value="{$ids}"/>
	<div class="div-flex">
		<i class="fa fa-quora i-color"></i>
		<div style="line-height: 35px"><b>{$row.customer.name}</b>（{$row.number}） {switch name="row.check_status"}
			{case value="0"}<b class="text-success">(审核中)</b>{/case}
			{case value="1"}<b class="text-success">(审核中)</b>{/case}
			{case value="2"}<b class="text-warning">(审核通过)</b>{/case}
			{case value="3"}<b class="text-danger">(审核拒绝)</b>{/case}
			{case value="4"}<b class="text-danger">(撤销审批)</b>{/case}
			{case value="9"}<b class="text-red">(作废)</b>{/case}
			{default /}
			{/switch}</div>
		<div class="btn-list" style="z-index: 999">
			{eq name="row.is_examine" value="1"}
			<a class="btn btn-success btn-ajax"  data-confirm="确认要审核通过吗？" data-refresh="true"
			   data-url="qingdongwms/examine/examine_record/examine?relation_type=quote&relation_id={$ids}&status=1" data-title="审核通过" >审核通过</a>
			<a class="btn btn-danger btn-ajax"  data-confirm="确认要审核拒绝吗？"  data-refresh="true" data-url="qingdongwms/examine/examine_record/examine?relation_type=quote&relation_id={$ids}&status=2" data-title="审核拒绝" >审核拒绝</a>
			{/eq}

			<a class="btn btn-info btn-edit" data-toggle="dropdown">编辑</a>
			<a class="btn btn-info" data-toggle="dropdown" id="download">下载报价单</a>
			{neq name="$row.status" value="9"}
			<a class="btn btn-info btn-contract" data-toggle="dropdown" id="contract">转为合同</a>
			<a class="btn btn-danger btn-cancel" data-toggle="dropdown">作废</a>
			{/neq}
		</div>
	</div>
	{if condition="isset($flow) && $flow"}
	{if condition="$flow.status == 1"}
	<div class="div-flex">
		<div class="form-group col-sm-10">

			<blockquote style="padding: 2px 10px;text-align: left">
				<p>审核信息 <span class="label label-danger">固定审批流</span></p>
			</blockquote>
			<div  style="text-align: left">
				<a href="javascript:void(0)" data-toggle="popover"
				   data-content="<p class='examine_title'>审批流程</p>
                   {foreach name='$examine_record' item='examine_r'}
                {if condition='$examine_r.status == 0'}
                {elseif condition='$examine_r.status == 1'}
                    <div class='examine_box'>
                        <i class='fa fa-check-circle text-success newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'>{$examine_r.check_time}</span></p>
                        <p>  {$examine_r.check_staff.name} <span class='text-muted'>通过了此申请</span></p>
                        {if condition='$examine_r.content'}<p class='examine_bg'>  {$examine_r.content}</p>{/if}
                    </div>
                {elseif condition='$examine_r.status == 2'}
                  <div class='examine_box'>
                        <i class='fa fa-window-close text-red newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'>{$examine_r.check_time}</span></p>
                        <p>  {$examine_r.check_staff.name} <span class='text-muted'>拒绝了此申请</span></p>
                        {if condition='$examine_r.content'}<p class='examine_bg'>  {$examine_r.content}</p>{/if}
                  </div>
                {else/}

                  <div class='examine_box'>
                        <i class='fa fa-window-close text-red newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'>{$examine_r.check_time}</span></p>
                        <p>  {$examine_r.check_staff.name} <span class='text-muted'>撤回了此申请</span></p>
                        {if condition='$examine_r.content'}<p class='examine_bg'>  {$examine_r.content}</p>{/if}
                  </div>
                {/if}
                {/foreach}" data-html="true">查看审批历史</a>
			</div>

			<div class="row rowbox" style="margin-left: 20px">
				{foreach name="$flow.stepList" item="val"}
				<div class="stafflist"  data-container="body" data-toggle="popover" data-placement="bottom" data-content="{foreach name='$val.stafflist' item='sf'}
                {if condition='$sf.examine_reord.status == 0'}
                <p><i class='fa fa-clock-o text-red'></i> {$sf.name} 待审核此申请</p>
                {elseif condition='$sf.examine_reord.status == 1'}
                <p><i class='fa fa-check-circle text-success'></i> {$sf.examine_reord.check_time}</p>
                <p>{$sf.name} 通过此申请</p>
                {elseif condition='$sf.examine_reord.status == 2'}
                <p><i class='fa fa-window-close text-red'></i> {$sf.examine_reord.check_time}</p>
                <p>{$sf.name} 拒绝此申请</p>
                {else/}
                <p><i class='fa fa-mail-reply text-red'></i> {$sf.name} 已撤销</p>
                {/if}
                {/foreach}" data-html="true">


					<img src="/assets/addons/qingdongwms/img/avatar.png" class="img-circle">
					{if condition="$val.status == 3"}
					<span class="text-muted">发起人主管</span>
					{elseif condition="$val.status == 2"/}
					<span class="text-muted">{:count($val.stafflist)}人并签</span>
					{else/}
					<span class="text-muted">{:count($val.stafflist)}人或签</span>
					{/if}

					{if condition="$val.order_id < $flow.order_id"}
					<p><span><i class="fa fa-check-circle text-success"></i> 审核通过</span></p>
					{else/}
					{if condition="$row.check_status == 3"}
					<p> <span><i class="fa fa-window-close text-red"></i> 审核拒绝</span></p>
					{else/}
					<p><span><i class="fa fa-clock-o text-red"></i> 待审核</span></p>
					{/if}
					{/if}

				</div>

				<div class="stafflist-right">
					<i class="fa fa-angle-right" style="color: #ccc;margin: 0 16px;font-size: 20px;font-weight: 600;"></i>
				</div>

				{/foreach}
			</div>


		</div>
	</div>
	{else/}
	<div class="div-flex">
		<div class="form-group col-sm-10">
			<blockquote style="padding: 2px 10px;text-align: left">
				<p>审核信息 <span class="label label-danger">发起人自选</span></p>
			</blockquote>
			<div  style="text-align: left">
				<a href="javascript:void(0)" data-toggle="popover"
				   data-content="<p class='examine_title'>审批流程</p>
                   {foreach name='$examine_record' item='examine_r'}
                {if condition='$examine_r.status == 0'}
                {elseif condition='$examine_r.status == 1'}
                    <div class='examine_box'>
                        <i class='fa fa-check-circle text-success newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'>{$examine_r.check_time}</span></p>
                        <p>  {$examine_r.check_staff.name} <span class='text-muted'>通过了此申请</span></p>
                        {if condition='$examine_r.content'}<p class='examine_bg'>  {$examine_r.content}</p>{/if}
                    </div>
                {elseif condition='$examine_r.status == 2'}
                  <div class='examine_box'>
                        <i class='fa fa-window-close text-red newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'>{$examine_r.check_time}</span></p>
                        <p>  {$examine_r.check_staff.name} <span class='text-muted'>拒绝了此申请</span></p>
                        {if condition='$examine_r.content'}<p class='examine_bg'>  {$examine_r.content}</p>{/if}
                  </div>
                {else/}

                  <div class='examine_box'>
                        <i class='fa fa-window-close text-red newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'>{$examine_r.check_time}</span></p>
                        <p>  {$examine_r.check_staff.name} <span class='text-muted'>撤回了此申请</span></p>
                        {if condition='$examine_r.content'}<p class='examine_bg'>  {$examine_r.content}</p>{/if}
                  </div>
                {/if}
                {/foreach}" data-html="true">查看审批历史</a>
			</div>
			<div class="row rowbox" style="margin-left: 20px">

				{foreach name="$flow.stepList.0.stafflist" item="val"}
				<div class="stafflist">
					<img src="{$val.img}" class="img-circle">
					<span class="text-muted">{$val.name}</span>
					{if condition="$val.examine_reord.status == 0"}
					<p><span><i class="fa fa-clock-o text-red"></i> 待审核</span></p>
					{elseif condition="$val.examine_reord.status == 1"}
					<p><span><i class="fa fa-check-circle text-success"></i> 审核通过</span></p>
					{else/}
					<p> <span><i class="fa fa-window-close text-red"></i> 审核拒绝</span></p>
					{/if}
				</div>

				<div class="stafflist-right">
					<i class="fa fa-angle-right" style="color: #ccc;margin: 0 16px;font-size: 20px;font-weight: 600;"></i>
				</div>

				{/foreach}
			</div>
		</div>
	</div>
	{/if}
	{/if}
	<div class="div-flex" style="margin-top: 20px">
		<div class="form-group">
			<span>报价单编号</span>
			<p><label>{$row.number}</label></p>
		</div>
		<div class="form-group">
			<span class="text-muted">审核状态</span>
			{switch name="row.check_status"}
			{case value="0"}<p class="text-success">审核中</p>{/case}
			{case value="1"}<p class="text-success">审核中</p>{/case}
			{case value="2"}<p class="text-primary">审核通过</p>{/case}
			{case value="3"}<p class="text-red">审核拒绝</p>{/case}
			{case value="4"}<p class="text-red">撤销审批</p>{/case}
			{default /}
			{/switch}
		</div>
		<div class="form-group">
			<span>客户名称</span>
			<p><a class="btn-dialog" data-url="qingdongwms/customer/customer/detail?ids={$row.customer_id}" data-area=["90%","90%"] data-title="客户详情" >{$row.customer.name}</a></p>
		</div>
		<div class="form-group">
			<span>报价金额</span>
			<p><label>{$row.quote_amount}</label></p>
		</div>
		<div class="form-group">
			<span>报价时间</span>
			<p><label>{$row.quote_date}</label></p>
		</div>
		<div class="form-group">
				<span>报价状态</span>
				{switch name="row.status"}
				{case value="0"}<p class="text-success">进行中</p>{/case}
				{case value="1"}<p class="text-success">转化成功</p>{/case}
				{case value="9"}<p class="text-red">作废</p>{/case}
				{default /}
				{/switch}
		</div>
		<div class="form-group">
			<span>创建时间</span>
			<p><label>{$row.createtime}</label></p>
		</div>
		<div class="form-group">
			<span>创建人</span>
			<p><label>{$row.create_staff.name}</label></p>
		</div>

	</div>

	<div>
		<ul class="nav nav-tabs" role="tablist">
			<li role="presentation" class="active"><a href="#basic" aria-controls="profile" role="tab" data-toggle="tab">产品信息</a></li>

			<li role="presentation"><a href="#settings3" aria-controls="settings" role="tab" data-toggle="tab">附件</a></li>
			<li role="presentation"><a href="#operation" aria-controls="settings" role="tab" data-toggle="tab">操作记录</a></li>

		</ul>

		<div class="tab-content">

			<div role="tabpanel" class="tab-pane fade panel-body active in" id="basic">
				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">报价单编号:</span>
						{$row.number}
					</div>
				</div>
				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">报价时间:</span>
						{$row.quote_date}
					</div>
				</div>

				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">优惠金额:</span>
						￥{$row.discount_amount}
					</div>
				</div>
				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">产品合计:</span>
						￥{$row.quote_amount}
					</div>
				</div>

				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">客户名称:</span>
						{$row.customer.name}
					</div>
				</div>
				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">客户联系人:</span>
						{$row.contacts.name}（{$row.contacts.mobile}）
					</div>
				</div>
				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">公司报价人:</span>
						{$row.order_staff.name}
					</div>
				</div>
				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">归属员工:</span>
						{$row.owner_staff.name}
					</div>
				</div>
				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">创建时间:</span>
						{$row.createtime}
					</div>
				</div>
				<div class="col-xs-6 col-sm-5">
					<div class="form-group col-sm-10">
						<span class="text-muted">更新时间:</span>
						{$row.updatetime}
					</div>
				</div>
				<div class="col-xs-10 col-sm-10">
					<div class="form-group col-sm-2">
						<span class="text-muted">特约条款:</span>
					</div>
					<div class="form-group col-sm-10">
						{$row.clause|html_entity_decode}
					</div>
				</div>
				<div class="col-xs-12 col-sm-12">
					<div class="form-group">
						{foreach name="product" item="val"}
						<div class="col-xs-6 col-sm-5">
							<div class="form-group col-sm-10">
								<div class="panel panel-default">
									<div class="panel-heading">产品名称:{$val.name}</div>
									<div class="panel-body">
										<p>产品单价:{$val.unit_price}</p>
										<p>产品数量:{$val.number} {$val.unit}</p>
										<p>价格小计:{$val.price}</p>
										<p>配置说明:{$val.config_desc}</p>
										<p>备注:{$val.remarks}</p>
									</div>
								</div>
							</div>
						</div>
						{/foreach}
					</div>
				</div>

				<div class="col-xs-6 col-sm-10">
					<div class="form-group col-sm-10">
						<span class="text-muted">报价凭证:</span>
						<div class="well">
							{if condition="$row.file_ids"}
							<div class="thumbnail">
								<a href="{$row.file_ids}" target="_blank">
								<img data-tips-image src="{$row.file_ids}" alt="">
								</a>
							</div>
							{/if}
						</div>
					</div>
				</div>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="operation">
				<table id="operation_log" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>

			<div role="tabpanel" class="tab-pane fade panel-body" id="settings3">
				<table id="files"       class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
					<div id="toolbar1" class="toolbar">
						{:build_toolbar('refresh')}
						<a class="btn btn-info btn-upload"   data-toggle="dropdown">上传</a>
					</div>
				</table>
			</div>

		</div>

	</div>
</div>